<?php

class ChiTietCuocKiemTraController extends BaseController {

    private $ctckt;

    //Ham xay dung
    function __construct() {
        $this->ctckt = new ChiTietCuocKiemTra();
    }

    //Phuong thuc hien ds thong tin
    public function index() {
        try {
            $id = Input::get("id");
            $data = $this->ctckt->GetOne($id);
            return View::make('tienhanhtt.index')
                            ->with("title", "Tiến hành thanh tra");  
        } catch (Exception $ex) {
            return View::make('tienhanhtt.error')
                            ->with("title", "Lỗi tiến hành thanh tra"); 
        }  
    }

    //Phuong thuc hien khung them thong tin
    public function add() {
       
    }

    //Phuong thuc xu ly luu thong tin moi
    public function save() {
      
    }

    //Phuong thuc hien khung sua thong tin xac dinh
    public function edit() {
      
    }

    //Phuong thuc xu ly luu thong tin da sua
    public function store() {

    }

    //Phuong thuc xoa mot thong tin nao do
    public function remove() {
       
    }

    //Phuong thuc tim kiem thong tin xac dinh theo thuc post
    public function search() {
        if (Request::ajax()) {
            $mst = Input::get('mst');
            try {
                $data = $this->ctckt->GetOneWithMST($mst);
                return Response::json($data);
            } catch (Exception $ex) {
                return Response::json(null);
            }
        }
    }

}
